# https://www.luogu.com.cn/problem/P1028
#AC

# def tabled_recursive(&func)
# 	value={}
# 	return lambda{|x| value[x] || func.(x) 	}
# end


def get_num(x)
	@value||={}
	#puts @value
	#puts"getnum(#{x})"
	if @value[x]==nil
		if x ==1 then @value[x]=1
		else @value[x]=1 + (1..x/2).collect{|i| get_num(i)}.reduce(:+)
		end
	end
	#puts "@value[#{x}]= #{@value[x]}"
	return @value[x]
end

N=readline.to_i
#puts "read #{N}"
# tabled_get_num=tabled_recursive(&get_num)

puts(get_num(N))